package com.example.design.templateDemo;

import com.example.design.utils.SpringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/template")
public class TestTemplate {
    @RequestMapping("/test")
    public String test(String doCode) {
        String beanName = TemplateEnum.getBeanName(doCode);
        DoTemplate doTemplate = (DoTemplate) SpringUtils.getBean(beanName);
        doTemplate.doSomeThing();
        return "执行成功";
    }
}
